import 'package:gluz/generated/json/base/json_convert_content.dart';
import 'package:gluz/app/data/shop/shop_evaluate_entity.dart';

ShopEvaluateEntity $ShopEvaluateEntityFromJson(Map<String, dynamic> json) {
  final ShopEvaluateEntity shopEvaluateEntity = ShopEvaluateEntity();
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    shopEvaluateEntity.id = id;
  }
  final String? productId = jsonConvert.convert<String>(json['productId']);
  if (productId != null) {
    shopEvaluateEntity.productId = productId;
  }
  final String? userId = jsonConvert.convert<String>(json['userId']);
  if (userId != null) {
    shopEvaluateEntity.userId = userId;
  }
  final int? orderId = jsonConvert.convert<int>(json['orderId']);
  if (orderId != null) {
    shopEvaluateEntity.orderId = orderId;
  }
  final int? orderItemId = jsonConvert.convert<int>(json['orderItemId']);
  if (orderItemId != null) {
    shopEvaluateEntity.orderItemId = orderItemId;
  }
  final int? rating = jsonConvert.convert<int>(json['rating']);
  if (rating != null) {
    shopEvaluateEntity.rating = rating;
  }
  final String? reviewContent = jsonConvert.convert<String>(
      json['reviewContent']);
  if (reviewContent != null) {
    shopEvaluateEntity.reviewContent = reviewContent;
  }
  final String? images = jsonConvert.convert<String>(json['images']);
  if (images != null) {
    shopEvaluateEntity.images = images;
  }
  final int? isAnonymous = jsonConvert.convert<int>(json['isAnonymous']);
  if (isAnonymous != null) {
    shopEvaluateEntity.isAnonymous = isAnonymous;
  }
  final int? status = jsonConvert.convert<int>(json['status']);
  if (status != null) {
    shopEvaluateEntity.status = status;
  }
  final String? userName = jsonConvert.convert<String>(json['userName']);
  if (userName != null) {
    shopEvaluateEntity.userName = userName;
  }
  final String? userImg = jsonConvert.convert<String>(json['userImg']);
  if (userImg != null) {
    shopEvaluateEntity.userImg = userImg;
  }
  final String? userCountry = jsonConvert.convert<String>(json['userCountry']);
  if (userCountry != null) {
    shopEvaluateEntity.userCountry = userCountry;
  }
  final String? memberLevel = jsonConvert.convert<String>(json['memberLevel']);
  if (memberLevel != null) {
    shopEvaluateEntity.memberLevel = memberLevel;
  }
  final String? createdTime = jsonConvert.convert<String>(json['createdTime']);
  if (createdTime != null) {
    shopEvaluateEntity.createdTime = createdTime;
  }
  final String? updatedTime = jsonConvert.convert<String>(json['updatedTime']);
  if (updatedTime != null) {
    shopEvaluateEntity.updatedTime = updatedTime;
  }
  return shopEvaluateEntity;
}

Map<String, dynamic> $ShopEvaluateEntityToJson(ShopEvaluateEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['productId'] = entity.productId;
  data['userId'] = entity.userId;
  data['orderId'] = entity.orderId;
  data['orderItemId'] = entity.orderItemId;
  data['rating'] = entity.rating;
  data['reviewContent'] = entity.reviewContent;
  data['images'] = entity.images;
  data['isAnonymous'] = entity.isAnonymous;
  data['status'] = entity.status;
  data['userName'] = entity.userName;
  data['userImg'] = entity.userImg;
  data['userCountry'] = entity.userCountry;
  data['memberLevel'] = entity.memberLevel;
  data['createdTime'] = entity.createdTime;
  data['updatedTime'] = entity.updatedTime;
  return data;
}

extension ShopEvaluateEntityExtension on ShopEvaluateEntity {
  ShopEvaluateEntity copyWith({
    String? id,
    String? productId,
    String? userId,
    int? orderId,
    int? orderItemId,
    int? rating,
    String? reviewContent,
    String? images,
    int? isAnonymous,
    int? status,
    String? userName,
    String? userImg,
    String? userCountry,
    String? memberLevel,
    String? createdTime,
    String? updatedTime,
  }) {
    return ShopEvaluateEntity()
      ..id = id ?? this.id
      ..productId = productId ?? this.productId
      ..userId = userId ?? this.userId
      ..orderId = orderId ?? this.orderId
      ..orderItemId = orderItemId ?? this.orderItemId
      ..rating = rating ?? this.rating
      ..reviewContent = reviewContent ?? this.reviewContent
      ..images = images ?? this.images
      ..isAnonymous = isAnonymous ?? this.isAnonymous
      ..status = status ?? this.status
      ..userName = userName ?? this.userName
      ..userImg = userImg ?? this.userImg
      ..userCountry = userCountry ?? this.userCountry
      ..memberLevel = memberLevel ?? this.memberLevel
      ..createdTime = createdTime ?? this.createdTime
      ..updatedTime = updatedTime ?? this.updatedTime;
  }
}